package com.ds.smartstudio.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
import com.ds.smartstudio.handler.ListToStringHandler;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import java.util.Date;
import java.util.List;

/**
 * <p>
 *
 * </p>
 *
 * @author yangsf
 * @since 2022-07-02 10:42:24
 */
@Data
@TableName(value = "ds_device", autoResultMap = true)
@Accessors(chain = true)
@ApiModel(value = "Device对象", description = "对应设备表")
public class Device {

    @ApiModelProperty("设备型号")
    @TableField("ds_device_model")
    private String dsDeviceModel;

    @ApiModelProperty("物理地址")
    @TableField("ds_device_mac")
    private String dsDeviceMac;

    @ApiModelProperty("安装位置  ")
    @TableField("ds_device_addr")
    private String dsDeviceAddr;

    @ApiModelProperty("是否禁用设备 0 为启用 1为禁用")
    @TableField("ds_device_disable")
    private Integer dsDeviceDisable;

    @ApiModelProperty("固件版本")
    @TableField("ds_device_firmware")
    private String dsDeviceFirmware;

    @ApiModelProperty("关联area表中的area_id字段，一个设备绑定一个场所 ")
    @TableField("ds_area_id")
    private Integer dsAreaId;

    @ApiModelProperty("设备类型，关联ds_type中ds_type_id字段")
    @TableField(value = "ds_type_id", typeHandler = ListToStringHandler.class)
    private List<Integer> dsTypeId;


    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private Date createTime;

    @TableField(value = "modify_time", fill = FieldFill.INSERT_UPDATE)
    private Date modifyTime;

    @TableId(value = "ds_device_id", type = IdType.AUTO)
    private Integer dsDeviceId;

    @TableField("ds_device_status")
    private Integer dsDeviceStatus;


    @TableField(exist = false)
    @ApiModelProperty("设备当前状态")
    private String state;

    @TableField("ds_device_run_status")
    private Integer dsDeviceRunStatus;

}
